<script type="text/javascript">
	function toRegister(){
		window.location.href = "user/register";
		return false;
	}
</script>
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">TimeAxis</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
	<ul class="nav navbar-nav">
		<% for(item in session.menu[0]) { %>
			<% if(session.menu[item.id].~size > 0) { %>
				<li id="${item.key}" class="dropdown">
	                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">${item.name}<span class="caret"></span></a>
	                <ul class="dropdown-menu">
	                 	<%  for(item2 in session.menu[item.id]) { %>
							<li id="page_${item2.key}"><a role="menuitem"  href="${item2.url}">${item2.name}</a></li>
						<% } %>
	                </ul>
	            </li>
			<% } else { %>
				<li id="${item.key}"><a href="${item.url}">${item.name}</a></li>
			<% } %>
		<% } %>
	</ul>
            
      <form class="navbar-form navbar-right">
        <div class="form-group">
          <input type="text" placeholder="账号" class="form-control">
        </div>
        <div class="form-group">
          <input type="password" placeholder="密码" class="form-control">
        </div>
        <button type="submit" class="btn btn-success">登陆</button>
        <button type="submit" class="btn btn-success" onclick="return toRegister();">注册</button>
      </form>
    </div><!--/.nav-collapse -->
  </div>
</nav>

